﻿using System.ComponentModel.DataAnnotations.Schema;
using Eleven.BreakAway.Model;
using System.Data.Entity.ModelConfiguration;

namespace Eleven.BreakAway.DataAccess
{
    class PersonConfiguration : EntityTypeConfiguration<Person>
    {
        public PersonConfiguration()
        {
            HasKey(p => p.SocialSecurityNumber)
                .Property(p => p.SocialSecurityNumber)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
            Property(p => p.LastName).IsRequired();
            Property(p => p.FirstName).IsRequired();
            //Property(p => p.RowVersion).IsRowVersion();
            Property(p => p.SocialSecurityNumber).IsConcurrencyToken();
        }
    }
}
